//
//  LikeView.m
//  PostBar
//
//  Created by lanou3g on 16/3/7.
//  Copyright © 2016年 GKZYAid. All rights reserved.
//

#import "LikeView.h"

@implementation LikeView

- (id)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addAllViews];
    }
    return self;
}

- (void)addAllViews
{
    self.buttonLike = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.buttonLike.frame = CGRectMake(0, 0, self.frame.size.width * 0.2, self.frame.size.height);
    [self.buttonLike setImage:[UIImage imageNamed:@"like"] forState:(UIControlStateNormal)];
    [self addSubview:self.buttonLike];
    
    self.labelLikeCount = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.buttonLike.frame) + self.frame.size.width * 0.04, self.buttonLike.frame.origin.y, self.frame.size.width * 0.3, self.buttonLike.frame.size.height)];
    self.labelLikeCount.textColor = [UIColor darkGrayColor];
    [self addSubview:self.labelLikeCount];
    
    self.buttonComment = [UIButton buttonWithType:(UIButtonTypeCustom)];
    self.buttonComment.frame = CGRectMake(CGRectGetMaxX(self.labelLikeCount.frame) + self.frame.size.width * 0.04, self.labelLikeCount.frame.origin.y, self.buttonLike.frame.size.width, self.buttonLike.frame.size.height);
    [self.buttonComment setImage:[UIImage imageNamed:@"comment"] forState:(UIControlStateNormal)];
    self.buttonComment.alpha = 0.5;
    [self addSubview:self.buttonComment];
    
    self.labelCommentCount = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.buttonComment.frame) +  self.frame.size.width * 0.04, self.buttonComment.frame.origin.y, self.labelLikeCount.frame.size.width, self.labelLikeCount.frame.size.height)];
    self.labelCommentCount.textColor = [UIColor darkGrayColor];
    [self addSubview:self.labelCommentCount];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
